/**
 * title:useCallback
 */
import { useCallback } from 'react';
import { useMemo } from 'react';

function App() {
  const onClick = useMemo(() => {
    return () => {
      console.log('按钮点击');
    };
  }, []);

  const onClick2 = useCallback(() => {
    console.log('按钮点击2');
  }, []);
  return (
    <div>
      <button onClick={onClick}>点击</button>
      <button onClick={onClick2}>点击2</button>
    </div>
  );
}

export default App;
